package com.qingzhuge.limiter.configuration;

import com.alibaba.csp.sentinel.cluster.ClusterStateManager;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author zeroxiao
 * @date 2019/9/6 14:47
 */
@Component
public class SentinelClusterRunner implements CommandLineRunner {

    @Override
    public void run(String... args) throws Exception {
        //token client ,CLUSTER_CLIENT 客户端角色，表示当前的节点是集群客户端
        ClusterStateManager.applyState(ClusterStateManager.CLUSTER_CLIENT);
    }
}